#ifndef GAMECONTROLLER_H
#define GAMECONTROLLER_H

#include <QObject>
#include <QGraphicsScene>
#include <QTimer>
#include "snake.h"
#include "food.h"


class GameController : public QObject
{
    Q_OBJECT
public:
    explicit GameController(QGraphicsScene* m_scene,QObject *parent = nullptr);

    void snakeAteFood(Food *food);
    void snakeAteItSelf();
    ~GameController();
signals:

public slots:
    void gameOver();
private:
    QGraphicsScene * m_scene;
    Snake* m_snake;
    QTimer m_timer;

    void pause();
    void resume();

    bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
    void handleKeyPressed(QKeyEvent* event);
    void addNewFood();

     void chageSpeed(int type);

     int m_circal;
     bool getGameStatus();
     int getGameSpeed();

};

#endif // GAMECONTROLLER_H
